<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml" xmlns:a4j="http://richfaces.org/a4j">
	<ui:define name="stylefms">
		<link href="/stylesheet/theme.css" rel="stylesheet" type="text/css" />
		<link href="/stylesheet/fms.css" rel="stylesheet" type="text/css" />
		<link href="/stylesheet/panel.css" rel="stylesheet" type="text/css" />
		<link href="/stylesheet/debug.css" rel="stylesheet" type="text/css" />
	</ui:define>
	<ui:define name="varProjectName">
		<ui:param name="projectName"
			value="#{appRes['mod.fms.fms.maintenances.personas']}" />
	</ui:define>

	<ui:define name="body">

		<a4j:form>
			<rich:panel style="width:500px" styleClass="operation_form" >
			<f:facet name="header"><h:outputText value="Tipo de operacion a realizar" /></f:facet>
			<h:panelGrid styleClass="operation_help" id="help">Ayuda</h:panelGrid>
				<h:selectOneRadio id="mainRadio" value="#{editPerson.operation}">
					<f:selectItem id="new" itemLabel="Nueva Persona" itemValue="newPerson"/>
										
					<f:selectItem id="upd" itemLabel="Modificar Persona" itemValue="updPerson" />
					
					<f:selectItem id="add" itemLabel="Agregar a Persona" itemValue="addPerson" />
					
					<a4j:support event="onclick" actionListener="#{editPerson.changeOperation}" reRender="mainTabs" />
				</h:selectOneRadio>
				<rich:toolTip for="help" mode="ajax">
					<h:panelGrid  style="width:300px">
					<ol>
					 <li>Nueva Persona: Registrar una nueva persona.</li>
					 <li>Modificar Persona: Modificar o dar de baja a una persona.</li>
					 <li>Agregar a Persona: Agregar nuevos datos a una persona como direcciones, documentos o telefonos.</li>
					 </ol>
					</h:panelGrid>
				</rich:toolTip>
			</rich:panel>

		</a4j:form>
		
		<rich:tabPanel id="mainTabs" switchType="ajax" selectedTab="#{editPerson.selectedTab}">
		<rich:tab label="Nueva Persona" id="newPerson" ajaxSingle="true">
			<a4j:region>
				<a4j:include viewId="/fms/fms/maintenances/fmsPersonNew.xhtml" />
			</a4j:region>
		</rich:tab>
		
		<rich:tab label="Modificar Persona" id="updPerson" ajaxSingle="true">
			<a4j:region>
				<a4j:include viewId="/fms/fms/maintenances/fmsPersonModify.xhtml" />
			</a4j:region>
				
		</rich:tab>
		
		<rich:tab label="Agregar a Persona" id="addPerson"  ajaxSingle="true">
			<a4j:region>
				<a4j:include viewId="/fms/fms/maintenances/fmsPersonAdd.xhtml" />
			</a4j:region>
		</rich:tab>

		</rich:tabPanel>

	</ui:define>
</ui:composition>